Data series
Work with chart data dynamically by setting new series, updating existing ones, or removing them as needed.
Set a candle series
Use ChartComponent.setAllSeries
to define one or more candle series on the chart.
- ChartComponent.setAllSeries
- Parameters
- mainSeries: CandleSeries
- secondarySeries: CandleSeries[]
- Returns
- void
ChartComponent.setAllSeries(mainSeries: CandleSeries, secondarySeries: CandleSeries[]): void
Sets the main and secondary series in one bulk operation. Reindexing and visual rerender happens at the same time.
Examples
Set single main series
Set multiple series
Update a data series
Use ChartComponent.updateAllSeries
to apply changes to current series data.
- ChartComponent.updateAllSeries
- Parameters
- mainSeries: CandleSeries
- secondarySeries: CandleSeries[]
- Returns
- void
ChartComponent.updateAllSeries(mainSeries: CandleSeries, secondarySeries: CandleSeries[]): void
Updates the main and secondary series in one bulk operation. Reindexing and visual rerender happens at the same time.
Examples
Remove a data series
- ChartComponent.removeDataFrom
- Parameters
- timestamp: number
- Returns
- void
ChartComponent.removeDataFrom(timestamp: number): void
Removes all data points from the main candle series that are newer than the given timestamp. Can be useful for data replay.